import Vue from 'vue'
import Router from 'vue-router'
import Login from "../components/views/Login/Login";
import MainDashboard from "../components/Layout/MainDashboard";
import DeviceInfo from "../components/views/DashBoard/DeviceInfo";
import TestCase from "../components/views/DashBoard/TestCase/TestCase";
import ScriptTools from "../components/views/DashBoard/ScriptTools";
import Settings from "../components/views/DashBoard/Settings";
import ServiceMonitor from "../components/views/DashBoard/ServiceMonitor/ServiceMonitor";
import TaskList from "../components/views/DashBoard/ServiceMonitor/TaskList";
import TaskInfo from "../components/views/DashBoard/ServiceMonitor/TaskInfo";
import SpecialTests from "../components/views/DashBoard/SpecialTests";

Vue.use(Router)

export default new Router({
  // mode设置有两个，一个是hash，一个是history，history模式路径没有#
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
      redirect: '/login'
    } ,
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/dashBoar',
      name: 'MainDashboard',
      component: MainDashboard,
      children: [
        {
          path: '/serviceMonitor',
          name: 'ServiceMonitor',
          component: ServiceMonitor,
        },
        {
          path: '/deviceInfo',
          name: 'DeviceInfo',
          component: DeviceInfo,
        },
        {
          path: '/testcase',
          name: 'TestCase',
          component: TestCase,
        },
        {
          path: '/scriptTools',
          name: 'ScriptTools',
          component: ScriptTools,
        },
        {
          path: '/settings',
          name: 'Settings',
          component: Settings,
        },
        {
          path: '/taskList',
          name: 'TaskList',
          component: TaskList,
        },
        {
          path: '/taskInfo',
          name: 'TaskInfo',
          component: TaskInfo,
        },
        {
          path: '/specialTests',
          name: 'SpecialTests',
          component: SpecialTests,
        },
      ]
    },
  ]
})
